package com.sen.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sen.entity.VipEntity;
import com.sen.service.VipService;
import com.sen.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * 控制会员日表
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-02-20 20:00:53
 */
@RestController
@RequestMapping("/vip")
public class VipController {
    @Autowired
    private VipService vipService;

    /**
     * 查看会员日信息
     */
    @RequestMapping("/queryAll")
    public R info(){
        List<VipEntity> vip = vipService.list();

        return R.ok().put("vip", vip);
    }
    /**
     * 通过id查看会员日信息
     */
    @RequestMapping("/queryById")
    public R queryById(){
        VipEntity vip = vipService.getById(1);

        return R.ok().put("vip", vip);
    }
    /**
     * 修改会员日及折扣
     */
    @RequestMapping("/update")
    public R update(VipEntity vip){
        System.out.println(vip);
		vipService.updateById(vip);

        return R.ok();
    }

}
